home *** CD-ROM | disk | FTP | other *** search
/ Aminet 6 / Aminet 6 - June 1995.iso / Aminet / disk / cdrom / CDPD3Fix_10.lha / CDPD3Fix / CDPD3Fix.s < prev    next >
Encoding:
Text File  |  1995-04-04  |  3.2 KB  |  142 lines

  1. ************************************************************
  2. *                                                          *
  3. *           CDPD3 Bugfix by P-O Yliniemi                   *
  4. *                                                          *
  5. ************************************************************
  6.  
  7.     include    "df0:LVOs.i"
  8.  
  9.     move.l    _AbsExecBase,a6
  10.     lea.l    intuiname(pc),a1
  11.     moveq.l    #0,d0
  12.     CallLib    OpenLibrary
  13.     move.l    d0,intuibase
  14.     beq.s    intuierr
  15.  
  16.     move.l    d0,a1
  17.     move.l    _LVOOpenWindowTagList+2(a1),NoWinTags+6
  18.  
  19.     move.l    #FixSize,d0
  20.     move.l    #$10001,d1
  21.     CallLib    AllocMem
  22.     move.l    d0,mem
  23.     beq.s    closeintui
  24.  
  25.     move.l    d0,a1
  26.     lea.l    NewOpenWinTags(pc),a0
  27.     move.l    #FixSize,d0
  28.     CallLib    CopyMem
  29.  
  30.     CallLib    Forbid
  31.     move.l    intuibase(pc),a1
  32.     move.l    mem,_LVOOpenWindowTagList+2(a1)
  33.     CallLib    SumLibrary
  34.     CallLib    Permit
  35.             
  36. closeintui:
  37.     move.l    intuibase(pc),a1
  38.     move.l    _AbsExecBase,a6
  39.     CallLib    CloseLibrary
  40. intuierr:
  41.     moveq.l    #0,d0
  42.     rts
  43.  
  44. ;---------------------------------------------------------------------    
  45. mem:    dc.l    0
  46. intuibase:
  47.     dc.l    0
  48. intuiname:
  49.     dc.b    "intuition.library",0
  50.  
  51. ;--------------------------------------------------------------------
  52. NewOpenWinTags:
  53.     movem.l    d2/a2,-(sp)
  54.     cmp.l    #0,a0        ; Do we have a NewWindow structure ?
  55.     beq.s    .NoNewWin    ; Nope! Check for Tags!
  56.     move.l    26(a0),d0    ; Check title string
  57.     beq.s    .NoNewWin    ; No title
  58.     move.l    d0,a2
  59.     cmp.b    #"F",(a2)+    ; Check for "F"
  60.     bne.s    .NoNewWin
  61.     cmp.b    #"F",(a2)+    ; Check for "F"
  62.     bne.s    .NoNewWin
  63.     
  64.     move.w    #0,0(a0)    ; LeftEdge = 0
  65.     move.w    #0,2(a0)    ; TopEdge  = 0
  66.     move.w    #640,4(a0)    ; Width    = 640
  67.     move.w    #100,6(a0)    ; Height   = 100
  68. .NoNewWin:
  69.     cmp.l    #0,a1        ; Do we have any tags ?
  70.     beq.w    NoWinTags    ; Nope! Use ordinary OpenWindowTagList()
  71.     move.l    a1,a2        ; Pointer to tag list
  72.     move.l    #$8000006e,d2    ; Tag to search for = WA_Title
  73.     bsr.s    FindTag
  74.     tst.l    d2
  75.     beq.s    NoWinTags    ; No title
  76.     move.l    d2,a2        ; Address of title to A2
  77.     cmp.b    #"F",(a2)+    ; Check for "F"
  78.     bne.s    NoWinTags
  79.     cmp.b    #"F",(a2)+    ; Check for "F"
  80.     bne.w    NoWinTags
  81.  
  82.     move.l    a1,a2        ; Pointer to tag list
  83.     move.l    #$80000064,d2    ; Search for WA_Left
  84.     bsr.s    FindTag
  85.     cmpa.l    #0,a2
  86.     beq.s    NoWinTags
  87.     move.l    #0,(a2)        ; New WA_Left
  88.  
  89.     move.l    a1,a2        ; Pointer to tag list
  90.     move.l    #$80000065,d2    ; Search for WA_Top
  91.     bsr.s    FindTag
  92.     cmpa.l    #0,a2
  93.     beq.s    NoWinTags
  94.     move.l    #0,(a2)        ; New WA_Top
  95.  
  96.     move.l    a1,a2        ; Pointer to tag list
  97.     move.l    #$80000066,d2    ; Search for WA_Width
  98.     bsr.s    FindTag
  99.     cmpa.l    #0,a2
  100.     beq.s    NoWinTags
  101.     move.l    #640,(a2)    ; New WA_Width
  102.  
  103.     move.l    a1,a2        ; Pointer to tag list
  104.     move.l    #$80000067,d2    ; Search for WA_Height
  105.     bsr.s    FindTag
  106.     cmpa.l    #0,a2
  107.     beq.s    NoWinTags
  108.     move.l    #100,(a2)    ; New WA_Height
  109. NoWinTags:    
  110.     movem.l    (sp)+,d2/a2
  111.     jmp    $0
  112.  
  113. ;----------------------- Find a tag and get value --------------------
  114. ; In:
  115. ;    A2 - Tag list address
  116. ;    D2 - Tag to search for
  117. ; Out:
  118. ;    A2 - Address of tag value
  119. ;    D2 - Tag value
  120. ;
  121.  
  122. FindTag:
  123.     suba.l    #4,a2        ; Adjust for loop
  124. .SearchTag:
  125.     adda.l    #4,a2        ; Adjust for next tag
  126.     cmp.l    #0,(a2)        ; TAG_END ?
  127.     bne.s    .MoreTags
  128.  
  129.     moveq.l    #0,d2        ; Clear value
  130.     move.l    d2,a2        ; Clear address
  131.     bra.s    .NoMoreTags
  132. .MoreTags:
  133.     cmp.l    (a2)+,d2    ; Check for tag
  134.     bne.s    .SearchTag    ; Not found - continue until TAG_END
  135.     move.l    (a2),d2        ; Get value of tag
  136. .NoMoreTags:
  137.     rts
  138.  
  139.  
  140. FixSize:    equ    *-NewOpenWinTags
  141.  
  142.